package com.souku.finance.application.ui.mine;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.souku.finance.application.R;
import com.souku.finance.application.base.BaseTitleBarActivity;
import com.souku.finance.application.http.UrlConstact;
import com.souku.finance.application.utils.Constant;
import com.souku.finance.application.utils.ShareUtil;

import butterknife.BindView;
import butterknife.ButterKnife;

public class WithDrawWebActivity extends BaseTitleBarActivity {

    @BindView(R.id.web_view)
    WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_with_draw_web);
        ButterKnife.bind(this);
        //设置WebView属性，能够执行Javascript脚本
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setUseWideViewPort(true);
        webView.getSettings().setLoadWithOverviewMode(true);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);// 当打开新链接时，使用当前的 WebView，不会使用系统其他浏览器
                return true;
            }
        });
        //加载需要显示的网页
        String userId = ShareUtil.getInstance().getString(Constant.UserId);
        String accessToken = ShareUtil.getInstance().getString(Constant.Token);
        String str = "memberId=" + userId + "&accessToken=" + accessToken + "&amount=" + getIntent().getStringExtra("amount") + "&remark=" + "啊啊" + "&appId=APP";
        webView.postUrl(UrlConstact.PAY_CASH, str.getBytes());
    }

    @Override
    public void internet() {

    }
}
